package com.burgeon.backend.SHOPBACKEND.controller;

import com.burgeon.backend.SHOPBACKEND.entity.TemplateSwtich;
import com.burgeon.backend.SHOPBACKEND.entity.recored.MessageRecore;
import com.burgeon.backend.SHOPBACKEND.service.OrderRateService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("templateSwitch6")
@RestController
@CrossOrigin
public class OrderRateController extends BaseController {
    @Autowired
    private OrderRateService orderRateService;

    /**
     * 获取是否超过多少天未评价
     * @return
     */
    @RequestMapping("getTemplateSwitch6")
    public ResponseResult<TemplateSwtich> getTemplateSwitch6(String account) {

        TemplateSwtich data = orderRateService.getTemplateSwitch6(account);

        return new ResponseResult<>(SUCCESS,data);
    }

    /**
     * 修改是否启用
     * @param account
     * @param isUse
     * @return
     */
    @RequestMapping("upIsUse")
    public ResponseResult<Integer> upIsUse(String account,String isUse,String templateSwitch6Value) {

        Integer data = orderRateService.upIsUse(account,isUse,templateSwitch6Value);

        return new ResponseResult<>(SUCCESS,data);
    }

}
